<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>JSON</title>
</head>
<body>

<script type="text/javascript">
    let clazz = {
        students : [
            {
                name:"张三" ,
                age:22 ,
                tag : [
                    "法外狂徒","90后"
                ]
            } ,
            {

            }
        ] ,
        createDate : new Date() ,  // 表示当前时间
        id : 1 ,
        name : "生产实习——软件一班——甲骨文" ,
        sum : function(){
            return   this.students.length ;
        }
    } ;

    console.log( typeof clazz ) ;
    console.log( clazz.id ) ;
    console.log( clazz.createDate ) ;
    console.log( clazz.name ) ;
    console.log( clazz.sum ) ;
    console.log( clazz.students[0].name ) ;

    let json = '{"result":true, "count":42}';
    let obj = JSON.parse(json);
    console.log(obj.count);
    // expected output: 42
    console.log(obj.result);
</script>
</body>
</html>